import { BottomTabScreenProps } from '@react-navigation/bottom-tabs';
import { CompositeScreenProps } from '@react-navigation/native';
import { NativeStackScreenProps } from '@react-navigation/native-stack';

// 任务类型
export interface Task {
  id: string;
  title: string;
  completed: boolean;
  createdAt: string;
}

// 新闻类型
export interface News {
  id: string;
  title: string;
  content: string;
  publishTime: string;
  read?: boolean;
}

// 用户类型
export interface User {
  id: string;
  name: string;
  email: string;
  avatar: string;
}

// 导航参数类型
export type RootStackParamList = {
  Main: undefined;
  NewsDetail: { newsId: string };
  TimerSettings: undefined;
};

export type TabParamList = {
  Home: undefined;
  Todo: undefined;
  News: undefined;
  Timer: undefined;
  Profile: undefined;
};

// 屏幕属性类型
export type RootStackScreenProps<Screen extends keyof RootStackParamList> =
  NativeStackScreenProps<RootStackParamList, Screen>;

export type TabScreenProps<Screen extends keyof TabParamList> =
  CompositeScreenProps<
    BottomTabScreenProps<TabParamList, Screen>,
    NativeStackScreenProps<RootStackParamList>
  >;

declare global {
  namespace ReactNavigation {
    interface RootParamList extends RootStackParamList {}
  }
}